home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 5_5.lha / 5_5 / 5_5cOa.c < prev    next >
C/C++ Source or Header  |  1993-08-08  |  1KB  |  51 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. include <stream.h>
  6. include <string.h>
  7. include <ctype.h>
  8. nt error(const char *fmt ...);
  9.  
  10. har prefix[512] = "....", *endprefix = &prefix[1];
  11. har *incr()
  12.  
  13.    *endprefix++ = '.';
  14.    *endprefix = '\0';
  15.    return prefix+1;
  16.  
  17. har *decr()
  18.  
  19.    *--endprefix = '\0';
  20.    return prefix;
  21.  
  22.  
  23. har *unctrl(unsigned int c)
  24.  
  25.    static char x[5];
  26.    char *p = x;
  27.  
  28.    if (c > 0177)
  29. *p++ = 'M', *p++ = '-', c -= 0200;
  30.    if ((c < 040) || (c == 0177))
  31. *p++ = '^', *p++ = c ^ 0100;
  32.    else
  33. *p++ = c;
  34.    *p = '\0';
  35.    return x;
  36.  
  37.  
  38. include "5_5A.h"    /* enum exprtype */
  39. include "5_5B.h"    /* class tree, expr, token */
  40.  
  41. include "5_5a0.c"    /* forward declarations */
  42.  
  43. include "5_5a5.c"    /* prim() */
  44. include "5_5a4.c"    /* term() */
  45. include "5_5a3.c"    /* get_expr() */
  46. include "5_5a2.c"    /* gettoken() */
  47. include "5_5a1.c"    /* expandtree, expr::expr() */
  48.  
  49. include "5_5b2.c"    /* treeval() */
  50. include "5_5b1.c"    /* expr::eval() */
  51.